/*----------------------------------------------------------*/
/*                                                          */
/*   Copyright (c) 1991 by Borland International            */
/*                                                          */
/*   Turbo Vision TVEDIT header file                        */
/*                                                          */
/*----------------------------------------------------------*/
/*
 *      Turbo Vision - Version 2.0
 *
 *      Copyright (c) 1994 by Borland International
 *      All Rights Reserved.
 *
 */

#if !defined(__TVEDIT_H)
#define __TVEDIT_H
#define Uses_TApplication
#define Uses_TEditWindow
#define Uses_TDeskTop
#define Uses_TRect
#define Uses_TEditor
#define Uses_TFileEditor
#define Uses_TFileDialog
#define Uses_TChDirDialog
#define Uses_TDialog
#define Uses_TProgram
#define Uses_TObject
#define Uses_TInputLine
#define Uses_TLabel
#define Uses_THistory
#define Uses_TCheckBoxes
#define Uses_TButton
#define Uses_MsgBox
#define Uses_TSItem
#define Uses_TMenuBar
#define Uses_TSubMenu
#define Uses_TKeys
#define Uses_TMenuItem
#define Uses_TStatusLine
#define Uses_TStatusItem
#define Uses_TStatusDef
#define Uses_TPoint

#include <QObject>
#include <iomanip.h>
#include <stdlib.h>
#include <strstrea.h>
#include <tvision/tv.h>

class TMenuBar;
class TStatusLine;
class TEditWindow;
class TDialog;

const int cmChangeDrct = 102;

class TEditorApp : public QObject, public TApplication
{
	Q_OBJECT
public:
	TEditorApp(int argc, char **argv, QObject *parent = nullptr);
	virtual void handleEvent(TEvent &event);
	static TMenuBar *initMenuBar(TRect);
	static TStatusLine *initStatusLine(TRect);
	virtual void outOfMemory();

private:
	TEditWindow *openEditor(const char *fileName, Boolean visible);
	void fileOpen();
	void fileNew();
	void changeDir();
};

ushort execDialog(TDialog *d, void *data);
TDialog *createFindDialog();
TDialog *createReplaceDialog();
ushort doEditDialog(int dialog, ...);

#endif // __TVEDIT_H
